.class public Les/dq0;
.super Ljava/lang/Object;
.source "SICBlockCipher.java"

# interfaces
.implements Lorg/bouncycastle/crypto/a;


# instance fields
.field private final a:Lorg/bouncycastle/crypto/a;

.field private final b:I

.field private c:[B

.field private d:[B

.field private e:[B


# direct methods
.method public constructor <init>(Lorg/bouncycastle/crypto/a;)V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p1, p0, Les/dq0;->a:Lorg/bouncycastle/crypto/a;

    .line 3
    invoke-interface {p1}, Lorg/bouncycastle/crypto/a;->a()I

    move-result p1

    iput p1, p0, Les/dq0;->b:I

    .line 4
    new-array v0, p1, [B

    iput-object v0, p0, Les/dq0;->c:[B

    .line 5
    new-array v0, p1, [B

    iput-object v0, p0, Les/dq0;->d:[B

    .line 6
    new-array p1, p1, [B

    iput-object p1, p0, Les/dq0;->e:[B

    return-void
.end method


# virtual methods
.method public a()I
    .locals 1

    .line 8
    iget-object v0, p0, Les/dq0;->a:Lorg/bouncycastle/crypto/a;

    invoke-interface {v0}, Lorg/bouncycastle/crypto/a;->a()I

    move-result v0

    return v0
.end method

.method public a([BI[BI)I
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/bouncycastle/crypto/DataLengthException;,
            Ljava/lang/IllegalStateException;
        }
    .end annotation

    .line 9
    iget-object v0, p0, Les/dq0;->a:Lorg/bouncycastle/crypto/a;

    iget-object v1, p0, Les/dq0;->d:[B

    iget-object v2, p0, Les/dq0;->e:[B

    const/4 v3, 0x0

    invoke-interface {v0, v1, v3, v2, v3}, Lorg/bouncycastle/crypto/a;->a([BI[BI)I

    const/4 v0, 0x0

    .line 10
    :goto_0
    iget-object v1, p0, Les/dq0;->e:[B

    array-length v2, v1

    if-lt v0, v2, :cond_2

    .line 11
    iget-object p1, p0, Les/dq0;->d:[B

    array-length p1, p1

    const/4 v2, 0x1

    sub-int/2addr p1, v2

    const/4 p2, 0x1

    :goto_1
    if-gez p1, :cond_0

    .line 12
    iget-object p1, p0, Les/dq0;->d:[B

    array-length p1, p1

    return p1

    .line 13
    :cond_0
    iget-object p3, p0, Les/dq0;->d:[B

    aget-byte p3, p3, p1

    const/16 p4, 0xff

    and-int/2addr p3, p4

    add-int/2addr p3, p2

    if-le p3, p4, :cond_1

    const/4 p2, 0x1

    goto :goto_2

    :cond_1
    const/4 p2, 0x0

    .line 14
    :goto_2
    iget-object p4, p0, Les/dq0;->d:[B

    int-to-byte p3, p3

    aput-byte p3, p4, p1

    add-int/lit8 p1, p1, -0x1

    goto :goto_1

    :cond_2
    add-int v2, p4, v0

    .line 15
    aget-byte v1, v1, v0

    add-int v4, p2, v0

    aget-byte v4, p1, v4

    xor-int/2addr v1, v4

    int-to-byte v1, v1

    aput-byte v1, p3, v2

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method public a(ZLorg/bouncycastle/crypto/b;)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    .line 1
    instance-of p1, p2, Les/fq0;

    if-eqz p1, :cond_0

    .line 2
    check-cast p2, Les/fq0;

    .line 3
    invoke-virtual {p2}, Les/fq0;->a()[B

    move-result-object p1

    .line 4
    iget-object v0, p0, Les/dq0;->c:[B

    array-length v1, v0

    const/4 v2, 0x0

    invoke-static {p1, v2, v0, v2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 5
    invoke-virtual {p0}, Les/dq0;->reset()V

    .line 6
    iget-object p1, p0, Les/dq0;->a:Lorg/bouncycastle/crypto/a;

    const/4 v0, 0x1

    invoke-virtual {p2}, Les/fq0;->b()Lorg/bouncycastle/crypto/b;

    move-result-object p2

    invoke-interface {p1, v0, p2}, Lorg/bouncycastle/crypto/a;->a(ZLorg/bouncycastle/crypto/b;)V

    return-void

    .line 7
    :cond_0
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string p2, "SIC mode requires ParametersWithIV"

    invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public reset()V
    .locals 4

    .line 1
    iget-object v0, p0, Les/dq0;->c:[B

    iget-object v1, p0, Les/dq0;->d:[B

    array-length v2, v1

    const/4 v3, 0x0

    invoke-static {v0, v3, v1, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 2
    iget-object v0, p0, Les/dq0;->a:Lorg/bouncycastle/crypto/a;

    invoke-interface {v0}, Lorg/bouncycastle/crypto/a;->reset()V

    return-void
.end method
